layui.define(['layer', 'form', 'laytpl'], function(exports){
  var laytpl = layui.laytpl;
  var vip = {
    init: function () {
      $('.vip').addClass('on');

      $.get('/account/isVip',function (result) {
        if(result){
          $('.con6-r').show();

          $.get('/member/getEffectiveVipData',function (result) {
            if(result.success){
              var data = result.data;
              var getTpl = $('#list-data').html(),
                  tbody = $("#data-body");
              laytpl(getTpl).render(result, function (html) {
                tbody.html(html);
              });
            }
          },'json')

        }else{
          $('.con12-r').show();
        }
      })
    }
  }
  vip.init();

  exports('vip2.0', {}); //注意，这里是模块输出的核心，模块名必须和use时的模块名一致
});